package org.liveboardgames.agricola.model.enums;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class ResourceTypeEnum {

  public static final String CLAY = "CLAY";

  public static final String WOOD = "WOOD";

  public static final String STONE = "STONE";

  public static final String REED = "REED";

  public static final String SHEEP = "SHEEP";

  public static final String BOAR = "BOAR";

  public static final String CATTLE = "CATTLE";

  public static final String FOOD = "FOOD";

  public static final String GRAIN = "GRAIN";

  public static final String VEGETABLE = "VEGETABLE";

  public static final List<String> VALUES = getValues();

  public static final List<String> ANIMALS = getAnimals();

  public static final List<String> NON_ANIMALS = getNonAnimals();

  public static final List<String> FEED_RESOURCES = getFood();

  public static Map<String, Integer> getResourceAsMap(String resourceType, int quantity) {
    Map<String, Integer> resourceAsMap = null;

    if (resourceType != null) {
      resourceAsMap = new HashMap<String, Integer>();
      resourceAsMap.put(resourceType, quantity);
    }

    return resourceAsMap;
  }

  private static List<String> getValues() {
    List<String> list = new ArrayList<String>();

    list.add(SHEEP);
    list.add(BOAR);
    list.add(CATTLE);
    list.add(WOOD);
    list.add(CLAY);
    list.add(REED);
    list.add(STONE);
    list.add(GRAIN);
    list.add(VEGETABLE);
    list.add(FOOD);

    return list;
  }

  private static List<String> getAnimals() {
    List<String> list = new ArrayList<String>();

    list.add(SHEEP);
    list.add(BOAR);
    list.add(CATTLE);

    return list;
  }

  private static List<String> getNonAnimals() {
    List<String> list = new ArrayList<String>();

    list.add(WOOD);
    list.add(CLAY);
    list.add(REED);
    list.add(STONE);
    list.add(GRAIN);
    list.add(VEGETABLE);
    list.add(FOOD);

    return list;
  }

  private static List<String> getFood() {
    List<String> list = new ArrayList<String>();

    list.add(GRAIN);
    list.add(VEGETABLE);
    list.add(FOOD);

    return list;
  }
}
